<div class="wrapper-bz-page">
    <div class="wrapper-bz-body">
        <div class="column-block block-left" style="width:800px;">
            <div class="column-title">活动</div>
            <div class="column-content">
                <div class="column-filter">

                </div>
                <div class="column-datagrid">
                    <table id="table_poem_clockin_activity" style="width:100%;height:100%"></table>
                </div>
            </div>
        </div>
        <div class="column-block block-right" style="left:810px;">
            <div class="column-title">活动打卡计划</div>
            <div class="column-content">
                <div class="column-filter">

                </div>
                <div class="column-datagrid">
                    <table id="table_poem_clockin_activity_plan" style="width:100%;height:100%"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="dialog_add_dictionary"></div>
<div id="dialog_edit_dictionary"></div>
<div id="dialog_add_dictionary_sub"></div>
<div id="dialog_edit_dictionary_sub"></div>
<script>
    $(function(){
        var listTable = [
            {subject_keyword:"poem_clockin_activity", page_code:"clockin_activity_left"},
            {subject_keyword:"poem_clockin_activity_plan", page_code:"clockin_activity_plan"},
        ];
        var selectLeftId = 0;
        var relateForeignId = 'clockin_activity_id';
        var datagridConfigList = $(document).getRelatedDatagridConfig(listTable, relateForeignId);
        // datagridConfigList[0]['config_datagrid'].onClickRow = function(index, row){
        //     selectLeftId = row.id;
        //     datagridConfigList[1].queryParams = {dictionary_id:row.id};
        //     $('#table_' + listTable[1].subject_keyword).datagrid(datagridConfigList[1]);
        // };

        console.log("config:", datagridConfigList);
        $.each(listTable, function(index, item){
            console.log("foreach:", index);
            $('#table_' + item.subject_keyword).datagrid(datagridConfigList[index]);
        });
    });
</script>